package com.guosifan.feign;

import com.guosifan.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("order")
public interface OrderClientFeign {

    @PostMapping("/order/save")
    public void save( Order order);

    @GetMapping("/order/findByUid/{uid}/{start}/{row}")
    public List<Order> findByUid(@PathVariable("uid")int uid, @PathVariable("start")int start, @PathVariable("row")int row);

    @GetMapping("/order/findByIdCount/{uid}")
    public int findByIdCount(@PathVariable("uid")int uid);

    @GetMapping("/order/findByState")
    List<Order> findByState(@RequestParam("start") int start, @RequestParam("row") int row);

    @GetMapping("/order/count")
    int count();

    @GetMapping("/order/updateState/{id}")
    void updateState(@PathVariable("id") int id);
}
